﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ahapply.aspx.cs" Inherits="pufflesweb.admin.Ahapply" %>
<%@ import Namespace="PBLL" %>
<%@ import Namespace="PDAL" %>
<%@ import Namespace="PModel" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body >
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" placeholder="请输入工号" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="搜索" />
            <a href="Ahelpadd.aspx" target="Apuffles">添加新救助申请信息</a>

            <br />
            <br />
            <table   align="center" border="1">
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                <tr><td>救助申请ID</td><td>救助狗名字</td><td>性别</td><td>年龄</td><td>健康状态</td><td>疫苗情况</td><td>详情</td><td>救助狗图片</td><td>救助地址</td><td>申请人名字</td><td>手机号码</td><td>微信号</td><td>QQ号</td><td>审批</td><td>操作</td></tr>

                <%
                    string id = Request.QueryString["HAID"];
                    if (id != null)
                    {
                        PBLL.HApply.del(int.Parse(id));
                        PF.JsHelper.AlertAndRedirect("删除成功", "Ahapply.aspx");
                    }

                    List<PModel.HApply> list = PBLL.HApply.list();
                    %>
                <% for (int i = 0; i < list.Count; i++)
                    {
                        string sex = "";
                        if(list[i].HAsex == 0)
                        {
                            sex = "男";
                        }
                        else if(list[i].HAsex == 1)
                        {
                            sex = "女";
                        }

                        string age = "";
                        if(list[i].HAage == 0)
                        {
                            age = "幼年期0-6个月";
                        }
                        else if(list[i].HAage == 1)
                        {
                            age = "少年期7个月-2岁";
                        }
                        else if(list[i].HAage == 2)
                        {
                            age = "中年期2岁-7岁";
                        }
                        else if(list[i].HAage == 3)
                        {
                            age = "老年期7岁以上";
                        }
                        else if(list[i].HAage == 4)
                        {
                            age = "未知";
                        }

                        string state = "";
                        if(list[i].HAstate == 0)
                        {
                            state = "健康";
                        }
                        else if(list[i].HAstate == 1)
                        {
                            state = "较为良好";
                        }
                        else if(list[i].HAstate == 2)
                        {
                            state = "一般";
                        }
                        else if(list[i].HAstate == 3)
                        {
                            state = "有点糟糕";
                        }
                        else if(list[i].HAstate == 4)
                        {
                            state = "非常糟糕";
                        }
                        else if(list[i].HAstate == 5)
                        {
                            state = "时好时坏";
                        }

                        string vaccine = "";
                        if(list[i].HAvaccine == 0)
                        {
                            vaccine = "未注射";
                        }
                        else if(list[i].HAvaccine == 1)
                        {
                            vaccine = "一针";
                        }
                        else if(list[i].HAvaccine == 2)
                        {
                            vaccine = "两针";
                        }
                        else if(list[i].HAvaccine == 3)
                        {
                            vaccine = "三针";
                        }
                        else if(list[i].HAvaccine == 4)
                        {
                            vaccine = "三针+狂犬疫苗";
                        }

                        string check = "";
                        if(list[i].HAcheck == 0)
                        {
                            check = "未审核";
                        }
                        else if(list[i].HAcheck == 1)
                        {
                            check = "审核通过";
                        }
                        else if(list[i].HAcheck == 2)
                        {
                            check = "审核不通过";
                        }

                        %>

                <tr><td><%=list[i].HAID%></td>
                    <td><% =list[i].HAdogname%></td>
                    <td><% =sex%></td>
                    <td><% =age%></td>
                    <td><%=state%></td>
                    <td><%=vaccine%></td>
                    <td><%=list[i].HAtext%></td>
                    <td><img src="../images/happlyimg/<%=list[i].HAimage%>" width="80px" /></td>
                    <td><%=list[i].HAaddress%></td>
                    <td><%=list[i].HAname%></td>
                    <td><%=list[i].HAphone%></td>
                    <td><%=list[i].HAwechat%></td>
                    <td><%=list[i].HAqq%></td>
                    <td><a href="Ahapply.aspx?HAID=<%=list[i].HAID%>">删除 </a> | <a href="Aapplyupdate.aspx?HAID=<%=list[i].HAID%>">修改</a>| <a href="Aapplycheck.aspx?HAID=<%=list[i].HAID%>"><%=check%></a></td></tr>
                <%} %>

            </table>
        </div>
    </form>
</body>
</html>

